#ifndef DATAS_H
#define DATAS_H

#include "config/ConfigDataModel.h"
#include "config/Items.h"

#define CONFIG_ITEM(TYPE,ID) \
    public: TYPE* ID = nullptr; \
    public: Q_PROPERTY(TYPE* ID MEMBER ID)

#define CONFIG_ENUM(TYPE,ID) \
    CONFIG_ITEM(ItemEnum,ID)

#define CONFIG_FLAG(TYPE,ID) \
    CONFIG_ITEM(ItemFlag,ID)

#define CONFIG_DATA_MODEL(TYPE,ID) \
    public: TYPE* ID = nullptr; \
    public: Q_PROPERTY(TYPE* ID MEMBER ID)

class Data2;
class Data1 : public ConfigDataModel
{
    Q_OBJECT
public:
    explicit Data1(QObject *parent = nullptr);

    enum OS { QT_TR_NOOP(Linux), QT_TR_NOOP(Win), QT_TR_NOOP(Mac) };
    Q_ENUM(OS)

    enum Option { T1, T2, T3 };
    Q_ENUM(Option)

    CONFIG_ITEM(ItemString, userName)
    CONFIG_ITEM(ItemInt, height)
    CONFIG_ITEM(ItemDouble, zoom)
    CONFIG_ITEM(ItemBool, isLogin)
    CONFIG_ITEM(ItemShortcut, shortCut)
    CONFIG_ENUM(OS, system)
    CONFIG_FLAG(Option, options)

    CONFIG_DATA_MODEL(Data2, data2)

};

class Data2 : public ConfigDataModel
{
    Q_OBJECT
public:
    explicit Data2(QObject *parent = nullptr);

    CONFIG_ITEM(ItemStringList, list)
    CONFIG_ITEM(ItemColor, textColor)



};

#undef CONFIG_ITEM
#undef CONFIG_ENUM
#undef CONFIG_FLAG
#undef CONFIG_DATA_MODEL

#endif // DATAS_H
